﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication2
{
    public partial class CheckBoxGrid : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
                return;

            var connection = new System.Data.SqlClient.SqlConnection();
            connection.ConnectionString = @"Data Source=.\Katmai;Initial Catalog=Test;Integrated Security=True";
            var sqlCommand = connection.CreateCommand();
            sqlCommand.CommandText = "SELECT * FROM Skola";

            var dataset = new System.Data.DataSet();
            var adapter = new System.Data.SqlClient.SqlDataAdapter();
            adapter.SelectCommand = sqlCommand;
            adapter.Fill(dataset);
            dgSkole.DataSource = dataset;
            dgSkole.DataBind();
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            var x = dgSkole.Rows[0].Cells[0];

        }
    }
}